/**
 * Created by Administrator on 2017/3/21.
 */
import React, {Component} from 'react';
import {Form, Input,  Alert, TreeSelect,DatePicker,Select  } from 'antd';
import {connect} from 'dva';
const FormItem = Form.Item;
const Option = Select.Option;
import moment from 'moment'
class AddPoliciesForm extends Component {
  constructor(props) {
    super(props);
    this.state = {
    };
  }
  componentDidMount() {
  }
  render() {
    const formItemLayoutWithLabel = {
      labelCol: {
        xs: {span: 24},
        sm: {span: 8},
      },
      wrapperCol: {
        xs: {span: 24},
        sm: {span: 12},
      }
    };
    const {getFieldDecorator} = this.props.form;

    return (
      <div>
      <Form onSubmit={this.handleSubmit}>
       <FormItem label= '开始日期'
                  {...formItemLayoutWithLabel}>
          {getFieldDecorator('started_at', {
            initialValue: moment(),
            rules: [{required: true}],

          })(
            <DatePicker
              style={{width:'100%'}}
              allowClear={false}
              format="YYYY-MM-DD"
            />
          )}
        </FormItem>
          <FormItem label= '结束日期'
                  {...formItemLayoutWithLabel}>
          {getFieldDecorator('ended_at', {
            rules: [{required: true}],
            initialValue: moment(),
          })(
            <DatePicker
              style={{width:'100%'}}
              allowClear={false}
              format="YYYY-MM-DD"
            />
          )}
        </FormItem>
        <FormItem
          {...formItemLayoutWithLabel}
          label={(
            <span>
               姓名
            </span>
          )}
        >
          {getFieldDecorator('name', {
            initialValue: '',
          })(
            <Input/>
          )}
        </FormItem>
        <FormItem
          {...formItemLayoutWithLabel}
          label={(
            <span>
               身份证
            </span>
          )}
        >
          {getFieldDecorator('id_number', {
            initialValue: '',
          })(
            <Input/>
          )}
        </FormItem>
        <div style={{width:'65%',margin:'0 auto'}}>
          <Alert message="姓名,身份证为空则导出全部" type="warning" />
        </div>

      </Form>
    </div>
    );
  }
}

const AddPoliciesFormWrap = Form.create()(AddPoliciesForm);
export default connect()(AddPoliciesFormWrap);
